﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using LanguageControlBase.Wpf;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace FinalTestMachine.View.MainUnits
{
    /// <summary>
    /// Wnd_FunsSetting.xaml 的交互逻辑
    /// </summary>
    public partial class Wnd_FunsSetting : Window
    {
        public Wnd_FunsSetting()
        {
            InitializeComponent();
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            lsb_Menu.ItemsSource = Unit_FunsViewHelper.demoViewModels;
            //lsb_Menu.DisplayMemberPath = "Name";
            lsb_Menu.SelectedIndex = 0;
            //将数据拷贝进去
            Unit_FunsViewHelper.Reflush();
        }

        private void Window_Closed(object sender, EventArgs e)
        {
            try
            {
                Funs.FunCommSelection.Cur.Save();
                Funs.FunSocketSettings.Cur.Save();
                Funs.FunLightPipeSettings.Cur.Save();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
    }
}
